﻿using System;
using System.Collections.Generic;
using System.Text;

namespace LFractalLib
{
    public class ProductionRule
    {
        private char nonTerminal = '\0';
        private string rule = "";

        public string Rule
        {
            get { return rule; }
            set { rule = value; }
        }


        public char NonTerminal
        {
            get { return nonTerminal; }
            set { nonTerminal = value; }
        }

        public ProductionRule(char ch, string r)
        {
            this.nonTerminal = ch;
            this.rule = r;
        }

        public void ToXmlWriter(ref System.Xml.XmlWriter oWriter)
        {
            oWriter.WriteStartElement("Rule");
            Entity.WriteNodeVale("Replace", this.nonTerminal.ToString(), ref oWriter);
            Entity.WriteNodeVale("With", this.Rule, ref oWriter);
            oWriter.WriteEndElement();

        }
    }
}
